home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / inet / ien / ien-150 < prev    next >
Text File  |  1988-12-01  |  13KB  |  696 lines

  1.  
  2.                                                                         
  3. IEN 150                                                  W. Plummer  BBN
  4.                                                           J. Postel  ISI
  5.                                                                June 1980
  6.  
  7.                        TCP JSYS CALLING SEQUENCES
  8.  
  9. This memo describes the TENEX and TOPS20 JSYSs for using TCP.  There are
  10. a number of parameters that are common to this set of JSYSs and these
  11. are described first.
  12.  
  13. These JSYSs use a Job Connection Number or "JCN" for connections in much
  14. the same way file manipulating JSYSs use a Job File Number or "JFN" for
  15. files.
  16.  
  17.    Typically a small number, the JCN is a handle on a connection, and is
  18.    assigned by the OPEN JSYS.
  19.  
  20. These JSYSs also use a Connection Block , either directly or implicitly
  21. by reference to an associated JCN.  The Connection Block is a 3-word
  22. block:
  23.  
  24.    Word-0:  16-bit Local Port.
  25.    Word-1:  8-bit Foreign Network and 24-bit Foreign Host.
  26.    Word-2:  16-bit Foreign Port.
  27.  
  28.    These values are right justified in the 36-bit word.
  29.  
  30. These JSYSs take flags in the left half of AC 1.
  31. Not all of these JSYSs look at all of the flags.  The flag bits are:
  32.  
  33.    Bit-0:  RH has JCN rather than pointer to connection block.
  34.    Bit-1:  Wait for the JSYS to complete.
  35.    Bit-5:  ForceSync -- cause SYN to be sent when OPEN executed.
  36.    Bit-6:  Persist -- keep resending SYN packet.
  37.    Bit-7:  Return statistics (STAT call only).
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57. Plummer & Postel                                                [page 1]
  58.  
  59.  
  60.                                                                         
  61. June 1980                                     TCP JSYS Calling Sequences
  62.  
  63.  
  64.  
  65. The SEND and RECV JSYSs use data buffers which have control blocks and
  66. which may be chained together to form a ring of buffers.  These control
  67. blocks are called Data Buffer Ring Elements.  The Data Buffer Ring
  68. Element Format is:
  69.  
  70.    Word-0:  Flags,,unused by TCP (typically a pointer to next buffer
  71.              header)
  72.    Word-1:  0,,Address of data buffer
  73.    Word-2:  Word/Byte count for this buffer
  74.  
  75.    Flags:
  76.  
  77.       Done:
  78.          Cleared when TCP receives this buffer. Set when TCP has
  79.          finished with it.
  80.  
  81.       Error:
  82.          Buffer has an error associated with it.
  83.  
  84.       EOL:
  85.          Send an end-of-letter with this buffer. Or, end-of-letter
  86.          received with this buffer.
  87.  
  88.       WordMode:
  89.          Buffer is formatted as 36-bit bytes. Off if buffer has four
  90.          8-bit bytes per word. (Not Implemented Yet, 36-bit mode not
  91.          supported.)
  92.  
  93.       Flag Bit Assignments:
  94.  
  95.          Bit 0:      Error
  96.          Bit 1:      Local
  97.          Bit 2:      Permanent
  98.          Bits 3-7:   Error Number
  99.          Bits 8-11:  Unused
  100.          Bit 12:     Done
  101.          Bits 13-15: Unused
  102.          Bit 16:     EOL
  103.          Bit 17:     Word Mode
  104.  
  105.       The error numbers are listed under "Error Returns".
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115. [page 2]                                                Plummer & Postel
  116.  
  117.  
  118.                                                                         
  119. TCP JSYS Calling Sequences                                     June 1980
  120.  
  121.  
  122.  
  123. The OPEN ans SEND JSYSs take a "Retransmission Parameters" word.  This
  124. is controls the retransmission function.
  125.  
  126.    The right half is the initial retransmission Interval which is to be
  127.    used.  If the right half is 0, the initial Interval will be computed
  128.    based on the measured round trip time. The left half of the
  129.    parameters word has two 9-bit quantities, called the Numerator and
  130.    the Denominator. In computing the next retransmission Interval from
  131.    the previous one, the TCP multiplies the Interval by the Numerator
  132.    and then divides by the Denominator.
  133.  
  134.       Interval = Interval * ( Numerator / Denominator )
  135.  
  136.    Common retransmission functions are:
  137.  
  138.    SRI PR demo:  Numerator=1, Denominator=1, Initial Interval=3.
  139.  
  140.       3 seconds constant retransmission interval with no backoff.
  141.  
  142.    BBN (vanilla):  Numerator=3, Denominator=2, Initial interval=0.
  143.  
  144.       Used in "average" conditions involving congested gateways and few
  145.       dropped packets.  150% backoff from best guess initial interval.
  146.  
  147.    BBN (old):  Numerator=4, Denominator=2, Initial interval=0.
  148.  
  149.       Same as above but 200% backoff.  Quickly hits the 1 minute maximum
  150.       interval and turns into slow, constant period retransmission.
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173. Plummer & Postel                                                [page 3]
  174.  
  175.  
  176.                                                                         
  177. June 1980                                     TCP JSYS Calling Sequences
  178.  
  179.  
  180.  
  181. Error Returns
  182.  
  183.    When a JSYS does an error return (returns  +1 instead of +2), AC 1
  184.    contains an error code.  This code is an 8-bit number (right
  185.    justified in the 36-bit word) composed as follows:
  186.  
  187.       Bit Assignments:
  188.  
  189.          Bit 28:       Error
  190.          Bit 29:       Local
  191.          Bit 30:       Permanent
  192.          Bits 31-35:   Error Number
  193.  
  194.       The error numbers are:
  195.  
  196.          0  Unknown Error
  197.          1  Argument Error in JSYS (no access, bad JCN, etc.)
  198.          3  Connection Not Open
  199.          4  Temporarily Out of Resources
  200.          6  Connection Already Exists
  201.          7  Connection Error or Rejected (No such TCB either here or
  202.             there.)
  203.          9  Transmission Timeout
  204.          12 Connection Closed or Closing (Closed remotely.)
  205.          15 Bad Buffer Argument
  206.          17 Bad Argument to CHANL
  207.          20 Funny pointer to STAT (wraps around memory, etc)
  208.          21 Bad Transfer Size to STAT
  209.          29 Cannot change security level (SCSLV)
  210.          31 TCP Not Available
  211.  
  212.    The Error bit indicates if an error occured, for example error number
  213.    12 might not have the Error bit set in response to a CLOSE call.  The
  214.    Local bit indicates if the situation is local to this host or is due
  215.    to the remote host.  The Permanent Bit indicates if the situation is
  216.    permanent, or temporary.
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231. [page 4]                                                Plummer & Postel
  232.  
  233.  
  234.                                                                         
  235. TCP JSYS Calling Sequences                                     June 1980
  236.  
  237.  
  238.  
  239. OPEN (JSYS 742)
  240.  
  241.    1/  Flags,,Pointer-to-Connection-Block
  242.    2/  Persistence in seconds
  243.    3/  Retransmission parameters
  244.  
  245.                                   OPEN
  246.  
  247.    R+1:  failure, code in AC 1
  248.    R+2:  OK, JCN (Job Connection Number) in AC 1
  249.  
  250.    Flags:
  251.  
  252.       ForceSync:
  253.  
  254.          On to force synchronization without any data having been sent.
  255.  
  256.       Wait:
  257.  
  258.          Don't return until connection is opened.
  259.  
  260.       Persistent:
  261.  
  262.          Keep trying by sending SYN packets periodically.
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289. Plummer & Postel                                                [page 5]
  290.  
  291.  
  292.                                                                         
  293. June 1980                                     TCP JSYS Calling Sequences
  294.  
  295.  
  296.  
  297. CLOSE (JSYS 743)
  298.  
  299.    1/  Flags,,JCN-or-Pointer
  300.  
  301.                                  CLOSE
  302.  
  303.    R+1:  failure, code in AC 1
  304.    R+2:  OK, connection fully closed
  305.  
  306.    Flags:
  307.  
  308.       JCNSupplied:
  309.  
  310.          On if RH of AC 1 has a JCN. Off if RH has Pointer-to-Connection
  311.          Blk.
  312.  
  313.       Wait:
  314.  
  315.          Wait for close to happen in both directions.
  316.  
  317.    Note that if the wait bit is not set, the JCN will remain valid,
  318.    allowing more RECVs to be done.  ABORT may be used to release the
  319.    handle when it has been discovered that the connection has
  320.    terminated.
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347. [page 6]                                                Plummer & Postel
  348.  
  349.  
  350.                                                                         
  351. TCP JSYS Calling Sequences                                     June 1980
  352.  
  353.  
  354.  
  355. SEND (JSYS 740)
  356.  
  357.    1/  Flags,,JCN or Pointer-to-Connection-Block
  358.    2/  0,,Pointer-to-Data-Ring
  359.    3/  Timeout in Seconds (0 for infinite)
  360.    4/  Retransmission parameters
  361.  
  362.                                   SEND
  363.  
  364.    R+1:  failure, error code in AC 1
  365.    R+2:  OK, JCN in AC 1
  366.  
  367.    Flags:
  368.  
  369.       JCNSupplied:
  370.  
  371.          On if RH of AC 1 has a JCN. Off if RH has Pointer-to-Connection
  372.          Blk.
  373.  
  374.       Wait:
  375.  
  376.          Wait for close to happen in both directions.
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405. Plummer & Postel                                                [page 7]
  406.  
  407.  
  408.                                                                         
  409. June 1980                                     TCP JSYS Calling Sequences
  410.  
  411.  
  412.  
  413. RECV (JSYS 741)
  414.  
  415.    1/  Flags,,JCN or Pointer-to-Connection-Block
  416.    2/  0,,Pointer-to-Data-Ring
  417.  
  418.                                   RECV
  419.  
  420.    R+1:  failure, error code in AC 1
  421.    R+2:  OK, JCN in AC 1
  422.  
  423.    Flags:
  424.  
  425.       JCNSupplied:
  426.  
  427.          On if RH of AC 1 has a JCN. Off if RH has Pointer-to-Connection
  428.          Blk.
  429.  
  430.       Wait:
  431.  
  432.          Wait for close to happen in both directions.
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463. [page 8]                                                Plummer & Postel
  464.  
  465.  
  466.                                                                         
  467. TCP JSYS Calling Sequences                                     June 1980
  468.  
  469.  
  470.  
  471. STAT (JSYS 745)
  472.  
  473.    1/  Flags,,JCN or Pointer-to-Connection-Block
  474.    2/  -N,,Offset into TCB
  475.    3/  -M,,Address in user's space
  476.  
  477.                                   STAT
  478.  
  479.    R+1:  failure, error code in AC 1
  480.    R+2:  OK.
  481.  
  482.    Flags:
  483.  
  484.       JCNSupplied:
  485.  
  486.          On if RH of AC 1 has a JCN. Off if RH has Pointer-to-Connection
  487.          Blk.
  488.  
  489.       Returns statistics:
  490.  
  491.          This flag causes the TCP to dump words from the statistics area
  492.          rather than a specific TCB. Thus, the JCN is irrelevant.  The
  493.          Source and Destination ACs are updated as if a TCB were being
  494.          dumped.
  495.  
  496.    If successful min(M, N) words have been transferred from the TCB to
  497.    the caller's space.  The TCB offset identifies where the transfer
  498.    starts and the Address in user space identifies the start of the
  499.    destination area.
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521. Plummer & Postel                                                [page 9]
  522.  
  523.  
  524.                                                                         
  525. June 1980                                     TCP JSYS Calling Sequences
  526.  
  527.  
  528.  
  529. CHANL (JSYS 746)
  530.  
  531.    1/  Flags,,JCN or Pointer-to-Connection-Block
  532.    2/  Six 6-bit bytes (channel numbers)
  533.  
  534.                                  CHANL
  535.  
  536.    R+1:   failure, error code in AC 1
  537.    R+2:  OK.  This fork will receive TCP PSIs
  538.  
  539.    Flags:
  540.  
  541.       JCNSupplied
  542.  
  543.          On if RH of AC 1 has a JCN. Off if RH has Pointer-to-Connection
  544.          Blk.
  545.  
  546.    Each of the 6-bit bytes may be 77 (octal) if no PSIs are desired for
  547.    the corresponding event.
  548.  
  549.       Bits  0- 5:   INTRP channel
  550.       Bits  6-11:   RECV buffer done
  551.       Bits 12-17:   SEND buffer done
  552.       Bits 18-23:   Error
  553.       Bits 24-29:   State change (open or close)
  554.       Bits 30-35:   EOL acknowledged (Not implemented)
  555.  
  556.    PSIs for the above may be dropped or be VERY tardy on heavily loaded
  557.    systems. Some defensive programming is required to guard against
  558.    these problems.  See TCPTST.MAC which checks the buffer rings both
  559.    when a "done" interrupt occurs and periodically.
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579. [page 10]                                               Plummer & Postel
  580.  
  581.  
  582.                                                                         
  583. TCP JSYS Calling Sequences                                     June 1980
  584.  
  585.  
  586.  
  587. ABORT (JSYS 747)
  588.  
  589.    1/  Flags,,JCN or Pointer-to-Connection-Block
  590.  
  591.                                  ABORT
  592.  
  593.    R+1:   error, code in AC 1
  594.    R+2:  OK, connection deleted
  595.  
  596.    Flags:
  597.  
  598.       JCNSupplied:
  599.  
  600.          On if RH of AC 1 has a JCN. Off if RH has Pointer-to-Connection
  601.          Blk.
  602.  
  603.    The local end of the connection is forgotten.  An attempt to notify
  604.    the remote end is made by sending a RST packet.  Should this not be
  605.    delivered, the other end will discover its half open connection the
  606.    next time it attempts to use it.
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637. Plummer & Postel                                               [page 11]
  638.  
  639.  
  640.                                                                         
  641. June 1980                                     TCP JSYS Calling Sequences
  642.  
  643.  
  644.  
  645. SCSLV (JSYS 744)
  646.  
  647.    1/  Flags,,JCN or Pointer-to-Connection-Block
  648.    2/  36 bit security value
  649.  
  650.                                  SCSLV
  651.  
  652.    R+1:  failure, error code in AC 1
  653.    R+2:  OK.  The security value has been associated with the connection
  654.  
  655.    Flags:
  656.  
  657.       JCNSupplied
  658.  
  659.          On if RH of AC 1 has a JCN. Off if RH has Pointer-to-Connection
  660.          Blk.
  661.  
  662.    The security value is not interpreted by the TCP (except to see that
  663.    it matches).  The number of bits of the security value actually used
  664.    varries depending on the actual security procedure being in use.  In
  665.    all cases the rightmost bits of the word are used.
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695. [page 12]                                               Plummer & Postel
  696.